CREATE TABLE jms_dm.dm_start_center_violate_detail_dt (
                                                          agent_code varchar(50) NULL COMMENT "代理区：发件网点代理区",
                                                          center_code varchar(50) NULL COMMENT "转运中心：始发中心发件网点code",
                                                          date_time date NULL COMMENT "日期",
                                                          scan_time datetime NULL COMMENT "发件时间",
                                                          waybill_no varchar(100) NULL COMMENT "运单号",
                                                          package_code varchar(100) NULL COMMENT "包号：发件扫描包号",
                                                          agent_name varchar(120) NULL COMMENT "代理区名称",
                                                          center_name varchar(120) NULL COMMENT "转运中心：始发中心发件网点name",
                                                          customer_code varchar(100) NULL COMMENT "客户编码",
                                                          customer_name varchar(120) NULL COMMENT "客户名称",
                                                          end_center_code varchar(50) NULL COMMENT "末端机构",
                                                          end_center_name varchar(120) NULL COMMENT "末端机构名称",
                                                          real_pick_network_code varchar(50) NULL COMMENT "揽收网点：订单表取件网点code ",
                                                          real_pick_network_name varchar(120) NULL COMMENT "揽收网点：订单表取件网点name ",
                                                          goods_type_code varchar(100) NULL COMMENT "物品类型",
                                                          goods_type_name varchar(120) NULL COMMENT "物品类型name",
                                                          package_length decimal(16, 2) NULL COMMENT "长",
                                                          package_wide decimal(16, 2) NULL COMMENT "宽",
                                                          package_high decimal(16, 2) NULL COMMENT "高",
                                                          package_inside_charge_weight decimal(16, 2) NULL COMMENT "内部计费重量",
                                                          flow_cnt int(11) NULL COMMENT "单流向数量",
                                                          terminal_dispatch_code varchar(120) NULL COMMENT "订单表三段码",
                                                          is_should_bagging tinyint(4) NULL COMMENT "是否应建包 1是 0否",
                                                          is_violate_bagging tinyint(4) NULL COMMENT "是否应建包  1是 0否",
                                                          violate_type varchar(100) NULL COMMENT "违规类型 :重量违规: 边长违规:单流向数量违规"
) ENGINE=OLAP 
DUPLICATE KEY(agent_code, center_code)
COMMENT "(始发)中心违规建包明细"
PARTITION BY RANGE(date_time)(
      START ("2023-01-01") END ("2023-01-15") EVERY (INTERVAL 1 day))
DISTRIBUTED BY HASH(`violate_type`) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "day",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-90",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);